-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config for controlling node ip resolution ordering #131
base: main
Are you sure you want to change the base?
Add config for controlling node ip resolution ordering #131
Conversation
Hi can you help us understand the issue first? So you're having an issue where the local node is on both system.local and system.peers but the IP address of that node is only valid in system.peers? How can we reproduce this scenario? Which Cassandra implementations/providers implement this logic? |
Of course! Thank you so much for looking into this, apologies for my delay in response. As far as I am aware, "AWS Keyspaces" is the only Cassandra implementation with this quirk, they currently present all IPs in the Because of this to get the external IP of a current node in AWS Keyspaces you must use the |
ea3b34f
to
a830f37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good but ideally we'd also have a test to make sure there is no regression in the future.
Maybe we can leverage the inmemory test client and test server that we have on the integration tests for this. Here's an example. You'll have to create a custom request handler so you can override the ip addresses that are returned, I think the default handler created by func NewSystemTablesHandler
doesn't work for this test case because it doesn't allow for a custom address in system.local and always returns an empty system.peers result.
} else if peersListContainsLocalHost { | ||
log.Warnf("Local host is also on the peers list, the peers list will be used as the source of truth: %v vs %v, ignoring the latter one.", peersListLocalHost, localHost) | ||
} else { | ||
log.Tracef("Local host is not on the peers list, it will be added: %v.", localHost) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change this to DEBUG level
Hello,
During node discovery, when ZDM proxy finds an entry present in both
system.peers
andsystem.local
it currently will always prefer node IP addresses returned bysystem.local
. Some Cassandra implementations handlesystem.local
&system.peer
tables differently, when thesystem.peer
table contains ALL nodes in the cluster and the ip addresses fromsystem.local
are invalid or should not be used then zdm-proxy will currently not work.This PR adds 2 new config properties (both defaulting to true, to maintain backwards compatability):
OriginPreferIpFromSystemLocal
- Sets origin clusters to prefer IP address fromsystem.local
TargetPreferIpFromSystemLocal
- Sets target clusters to prefer IP address fromsystem.local
These can be used to control the resolution order of IP addresses and would allow for DataStax customers to better migrate from other Cassandra providers.
I am putting this PR out in its current form as an initial conversation starter, I am more than happy to add test coverage for this change, or make other changes, if it is a feature DataStax approves of.